<?php
include("admin_check.php");
include_once("../function.php");
include_once("../class/member_class.php");
include_once("../class/ulevel_class.php");

set_time_limit(0);
ignore_user_abort(true);
session_start();
header("Content-Type: text/html;charset=utf-8");
checkqx(1,1);?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/table.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script src="../js/calendar.js"></script>
    <link href="../layui-master/dist/css/layui.css" rel="stylesheet" type="text/css">
    <script src="../layui-master/dist/layui.js"></script>
<title>奖励会员</title>
<SCRIPT LANGUAGE=javascript>
<!--
function SelectAll() {
	for (var i=0;i<document.form1.UID.length;i++) {
		var e=document.form1.UID[i];
		e.checked=!e.checked;
	}
}
-->
</script>
</head>
<body>
<form name="form1" method="post" action="?">
<table width="100%" cellpadding="3" cellspacing="1" border="0" align="center" class="layui-table" lay-skin="line">
     </form>
      <tr>
        <td height="20" colspan="10" align="center">奖励达标会员</td>
      </tr>
      <tr style="display:none">
        <td height="20" colspan="10" align="center"><font color=red>说明:1、在后台激活会员的，该会员所属的服务中心或者县区店不会扣除激活电子币，同样报单服务费或者店补也拿不到。2、空单会员不算业绩，但是空单伞下有实单业绩，空单可以拿到奖金。(以上操作仅限后台操作，会员区专卖店或者服务中心激活不存在这种情况)</font></td>
      </tr>
      <tr>
      <!-- 	<td height="21" align="center"><input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()"></td> -->
        <td align="center">会员编号</td>
        <td align="center">会员名称</td>
        <td align="center">达标内容</td>
        <td align="center">详细信息</td>
        </tr>
      <?php
	  	$pagesize = 20; //设置每页记录数 
	  	$sql = "SELECT * FROM `member` WHERE maxmey>3000";
		if($query = mysql_query($sql)){
	  		$sum = mysql_num_rows($query); //计算总记录数 
		}else{
			$sum=0;	
		} 
		if($sum % $pagesize == 0) //计算总页数 
			$total = (int)($sum/$pagesize); 
		else 
			$total = (int)($sum/$pagesize) + 1; 
			if (isset($_GET['page'])) //获得页码
			{ 
				$p = (int)$_GET['page'];
			} 
			else 
			{ 
				$p = 1;
			}
			if ($p>$total){
				$p=$total;	
			}
		$start = $pagesize * ($p - 1); //计算起始记录 
      	$sql = "SELECT * FROM `member` WHERE maxmey>3000 order by id asc limit ".$start.",".$pagesize;
		if($query = mysql_query($sql)){
		while ($row=mysql_fetch_array($query)){
			if($row['mey']>=1000000){
	  ?>
     	 <tr>
	        <td align="center"><?=$row['nickname']?></td>
	        <td align="center"><?=$row['username']?></td>
	        <td align="center">奖价值500000住房一套</td>
	        <td align="center">
	        <input type="button" class="button" id="button" name="button1" value="查看" onClick="window.location.href='admin_UpdateProfile.php?ID=<?=$row['id']?>'" />
	        </td>
       </tr>
     <?php }else if($row['maxmey']>=500000 && $row['maxmey']<1000000){?>
	      <tr>
		        <td align="center"><?=$row['nickname']?></td>
		        <td align="center"><?=$row['username']?></td>
		        <td align="center">奖价值100000元轿车一辆</td>
		        <td align="center">
		        <input type="button" class="button" id="button" name="button1" value="查看" onClick="window.location.href='admin_UpdateProfile.php?ID=<?=$row['id']?>'" />
		        </td>
	       </tr>
     <?php }else if($row['maxmey']>=50000 && $row['maxmey']<500000){?>
     <tr>
		        <td align="center"><?=$row['nickname']?></td>
		        <td align="center"><?=$row['username']?></td>
		        <td align="center">奖价值8000元笔记本电脑一台</td>
		        <td align="center">
		        <input type="button" class="button" id="button" name="button1" value="查看" onClick="window.location.href='admin_UpdateProfile.php?ID=<?=$row['id']?>'" />
		        </td>
	       </tr>
	        <?php }else if($row['maxmey']>=10000 && $row['maxmey']<50000){?>
     <tr>
		        <td align="center"><?=$row['nickname']?></td>
		        <td align="center"><?=$row['username']?></td>
		        <td align="center">奖价值3000元的数码相机一部</td>
		        <td align="center">
		        <input type="button" class="button" id="button" name="button1" value="查看" onClick="window.location.href='admin_UpdateProfile.php?ID=<?=$row['id']?>'" />
		        </td>
	       </tr>
      <?php
      			}
			}
		}
	  ?>
      <tr>
        <td height="21" colspan="10" align="right">
        <table width="100%" border="0">
          <tr>
           <!-- <td align="left"><input name="button" type="submit" class="layui-btn layui-btn-small" id="button" value="激活会员" onClick="{if(confirm('您确定要激活该会员吗?')){this.document.selform.submit();return true;}return false;}">
            <input name="button2" type="submit" class="layui-btn layui-btn-small" id="button2" value="团队领导" onClick="{if(confirm('您确定要将该会员设置为团队领导吗?')){this.document.selform.submit();return true;}return false;}">-->
            <!--<input name="button3" type="submit" class="layui-btn layui-btn-small" id="button3" value="空单会员" onClick="{if(confirm('您确定要将该会员设置为空单会员吗?')){this.document.selform.submit();return true;}return false;}">
            <input name="button4" type="submit" class="layui-btn layui-btn-radius layui-btn-danger" id="button4" value="删除会员" onClick="{if(confirm('您确定要删除该会员吗?')){this.document.selform.submit();return true;}return false;}"></td>-->
            <td align="right"><?php echo fenye($p,$pagesize,$sum,$total,$cx)?></td>
          </tr>
        </table></td>
      </tr>
    </table>
    </form>
</body>
</html>